home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Ham Radio 2000
/
Ham Radio 2000.iso
/
ham2000
/
packet
/
terminal
/
top_152
/
src152.exe
/
rar
/
TOPMRK.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1995-05-16
|
16KB
|
478 lines
{┌─────────────────────────────────────────────────────────────────────────┐}
{│ │}
{│ T. O. P. │}
{│ │}
{│ (T)he (O)ther (P)acket │}
{│ │}
{│ T O P M R K . P A S │}
{│ │}
{│ │}
{│ Routinen zum Lesen und Schreiben des Merkerfiles MERKER.TOP │}
{└─────────────────────────────────────────────────────────────────────────┘}
Procedure Merker_Conn_Schreiben;
var i,i1 : Byte;
Flag : Boolean;
Begin
Flag := false;
for i := 1 to maxLink do with K[i]^ do if connected then
begin
if not Flag then
begin
Assign(G^.TFile,Sys1Pfad + ConDatei);
FiResult := RewriteTxt(G^.TFile);
end;
Flag := true;
Writeln(G^.TFile,LZ);
Writeln(G^.TFile,Rcon,i,MrkCALL,Call);
Writeln(G^.TFile,Rcon,i,MrkDATE,QSO_Date);
Writeln(G^.TFile,Rcon,i,MrkBEG,QSO_Begin);
i1 := pos(M1,ConText);
if i1 = 0 then G^.DZeile := ConText
else G^.DZeile := Copy(ConText,1,i1-1);
Writeln(G^.TFile,Rcon,i,MrkTEXT,G^.DZeile);
Writeln(G^.TFile,Rcon,i,MrkART,SysArt,Km,UserArt);
end;
if Flag then FiResult := CloseTxt(G^.TFile);
End;
Procedure Merker_Conn_Lesen;
Var i : Byte;
Procedure ConRead(Fstr : str10);
var Flag : Boolean;
Begin
Flag := false;
FiResult := ResetTxt(G^.TFile);
While not Flag and not Eof(G^.TFile) do
begin
Readln(G^.TFile,G^.DZeile);
if copy(G^.DZeile,1,length(Fstr)) = Fstr then
begin
Flag := true;
delete(G^.DZeile,1,pos(GL,G^.DZeile));
KillStartBlanks(G^.DZeile);
KillEndBlanks(G^.DZeile);
end;
end;
if not Flag then G^.DZeile := '';
End;
Begin
Assign(G^.TFile,Sys1Pfad + ConDatei);
if ResetTxt(G^.TFile) = 0 then
begin
for i := 1 to maxLink do with K[i]^ do
begin
ConRead(Rcon + int_str(i) + MrkCALL);
if G^.DZeile > '' then
begin
Call := G^.DZeile;
ConRead(Rcon + int_str(i) + MrkDATE);
if G^.DZeile > '' then QSO_Date := G^.DZeile;
ConRead(Rcon + int_str(i) + MrkBEG);
if G^.DZeile > '' then QSO_Begin := G^.DZeile;
ConRead(Rcon + int_str(i) + MrkTEXT);
if G^.DZeile > '' then ConText := G^.DZeile;
ConRead(Rcon + int_str(i) + MrkART);
if G^.DZeile > '' then
begin
SysArt := Byte(str_int(ParmStr(1,Km,G^.DZeile)));
UserArt := Byte(str_int(ParmStr(2,Km,G^.DZeile)));
if SysArt in [0..maxSCon] then SCon[SysArt] := true
else SysArt := 0;
if (SysArt = 11) and HoldDXc then
begin
G^.DZeile := HoldDXcStr;
Link_erhalter(i,G^.DZeile);
SetzeFlags(i);
end;
if not(UserArt in [1..maxUser]) then UserArt := 1;
end;
connected := true;
end;
end;
FiResult := CloseTxt(G^.TFile);
end;
End;
Procedure Merker_File_Schreiben;
Var i,i1 : Integer;
Kanal : Byte;
Hstr : String[80];
Begin
Assign(G^.TFile,Sys1Pfad + MerkDatei);
if RewriteTxt(G^.TFile) = 0 then
Begin
Writeln(G^.TFile,LZ);
for i := 1 to maxTNC do if TNC_used[i] then with TNC[i]^ do
begin
if BText = '' then BText := 'CQ';
Writeln(G^.TFile,Rrtn,i,':BT=',BText);
if BPfad = '' then BPfad := 'ALL';
Writeln(G^.TFile,Rrtn,i,':BP=',BPfad);
if Bake then Write(G^.TFile,Rrtn,i,Rpar,GL,'1,')
else Write(G^.TFile,Rrtn,i,Rpar,GL,'0,');
Write(G^.TFile,BTimer,Km);
Write(G^.TFile,CText,Km);
Write(G^.TFile,Info,Km);
Write(G^.TFile,Aktuell,Km);
Write(G^.TFile,QText,Km);
Write(G^.TFile,Fix,Km);
Writeln(G^.TFile,QRG_Akt);
end else
begin
Writeln(G^.TFile,Rrtn,i,':BT=','CQ');
Writeln(G^.TFile,Rrtn,i,':BP=','ALL');
Writeln(G^.TFile,Rrtn,i,Rpar,GL,'0,20,1,1,1,1,1');
end;
Writeln(G^.TFile,LZ);
for Kanal := 0 to maxLink do
Begin
Writeln(G^.TFile,LZ);
with K[Kanal]^ do
begin
if Kanal > 0 then
begin
if OwnCall = '*' then OwnCall := TNC[TncNummer]^.HostCall;
Writeln(G^.TFile,Rrch,Kanal,':CALL=',OwnCall);
if AutoZyConst > 0 then
Writeln(G^.TFile,Rrch,Kanal,':AUTO=',AutoZyConst);
end;
Writeln(G^.TFile,Rrch,Kanal,
Rpar + GL,MaxFrame,Km,PacLen,Km,ObStat,Km,UnStat,Km,UmlautMerk);
if RX_Save then
begin
CloseRxFile(Kanal,1);
Writeln(G^.TFile,Rrch,Kanal,':RXS=',FRxName);
RX_Save := false;
RX_Bin := 0;
end;
if Save then
begin
FiResult := CloseBin(SFile);
Writeln(G^.TFile,Rrch,Kanal,':SAV=',FName_aus_FVar(SFile));
Save := false;
end;
if SPlus and SplSave then
begin
Writeln(G^.TFile,Rrch,Kanal,':7PL=',FName_aus_FVar(SplFile),' ',
Spl_gLaenge,' ',Spl_gCount,' ',Spl_tLaenge,' ',Spl_tCount);
FiResult := CloseBin(SplFile);
SplSave := false;
end;
Write(G^.TFile,Rrch,Kanal,':FLAG=');
if Umlaut > 0 then Write(G^.TFile,'U',Umlaut);
if Echo > 0 then Write(G^.TFile,'E',Echo);
if not Gross then Write(G^.TFile,'Y');
if Kanal > 0 then
begin
if Auto then Write(G^.TFile,'F');
if TopBox then Write(G^.TFile,'M');
if Rx_Beep then Write(G^.TFile,'∞');
if morsen then Write(G^.TFile,'C');
if TxBeepAck then Write(G^.TFile,'Q');
if Speek then Write(G^.TFile,'P');
if AutoBin then Write(G^.TFile,'$');
if SPlus then Write(G^.TFile,'+');
if TxComp then Write(G^.TFile,'°');
if RxComp then Write(G^.TFile,'≈');
if NoCurJump then Write(G^.TFile,'÷');
end else
begin
if Klingel then Write(G^.TFile,'K');
if CtrlBeep then Write(G^.TFile,'G');
if Time_stamp then Write(G^.TFile,'T');
if PacOut then Write(G^.TFile,'L');
if ZeigeRET then Write(G^.TFile,'R');
if ConMorsen then Write(G^.TFile,'O');
if ReconMorsen then Write(G^.TFile,'D');
if ConVoice then Write(G^.TFile,'A');
if ReconVoice then Write(G^.TFile,'J');
if GlobalTrenn then Write(G^.TFile,'H');
if BinOut then Write(G^.TFile,'i');
if Ins then Write(G^.TFile,'Z');
if NoBinMon then Write(G^.TFile,'!');
if RX_TX_Win then Write(G^.TFile,'&');
end;
Writeln(G^.TFile);
end;
end;
Writeln(G^.TFile,LZ);
Writeln(G^.TFile,LZ);
Hstr := '';
for i := 1 to 10 do Hstr := Hstr + int_str(G^.SETL[i]) + Km;
Hstr := Hstr + int_str(SETNr);
Writeln(G^.TFile,Rrgl,Rsetl,GL,Hstr);
if Idle_Pos then i := 1
else i := 0;
Hstr := int_str(i) + Km + int_str(Idle_Anz) + Km + int_str(Idle_Tout);
Writeln(G^.TFile,Rrgl,Ridle,GL,Hstr);
Writeln(G^.TFile,Rrgl,Rmfreq,GL,G^.TonHoehe);
if _VGA then i := 1
else i := 0;
Writeln(G^.TFile,Rrgl,Rega,GL,int_str(i));
Writeln(G^.TFile,Rrgl,Rplen,GL,MPause);
Writeln(G^.TFile,Rrgl,Rsynch,GL,Resync_Z);
Writeln(G^.TFile,Rrgl,Rcnr,GL,CNr);
Writeln(G^.TFile,Rrgl,Rvsp,GL,VSpeed);
Writeln(G^.TFile,Rrgl,Rinfo,GL,G^.InfoStr);
FiResult := CloseTxt(G^.TFile);
end;
End;
Procedure Merker_File_Lesen;
Var Result : Word;
Hstr : String[10];
i,i1,
i2,C : Integer;
Procedure MerkRead(Fstr : Str10);
var Flag : Boolean;
Begin
Flag := false;
FiResult := ResetTxt(G^.TFile);
While not Flag and not Eof(G^.TFile) do
begin
Readln(G^.TFile,G^.DZeile);
if copy(G^.DZeile,1,length(Fstr)) = Fstr then
begin
Flag := true;
delete(G^.DZeile,1,pos(GL,G^.DZeile));
KillStartBlanks(G^.DZeile);
KillEndBlanks(G^.DZeile);
end;
end;
if not Flag then G^.DZeile := '';
End;
Begin
Assign(G^.TFile,Sys1Pfad + MerkDatei);
if ResetTxt(G^.TFile) = 0 then
begin
WriteTxt(XCP,SZ1,StartColor,MerkDatei);
XCP := XCP + SZL;
for i := 1 to TNC_Anzahl do with TNC[i]^ do
begin
MerkRead(Rrtn + int_str(i) + ':BT');
if G^.DZeile > '' then Btext := G^.DZeile;
MerkRead(Rrtn + int_str(i) + ':BP');
if G^.DZeile > '' then BPfad := G^.DZeile;
MerkRead(Rrtn + int_str(i) + Rpar);
if G^.DZeile > '' then
begin
Bake := ParmStr(1,Km,G^.DZeile) = '1';
BTimer := Word(str_int(ParmStr(2,Km,G^.DZeile)));
if BTimer = 0 then BTimer := 20;
CText := Byte(str_int(ParmStr(3,Km,G^.DZeile)));
Info := Byte(str_int(ParmStr(4,Km,G^.DZeile)));
Aktuell := Byte(str_int(ParmStr(5,Km,G^.DZeile)));
QText := Byte(str_int(ParmStr(6,Km,G^.DZeile)));
Fix := Byte(str_int(ParmStr(7,Km,G^.DZeile)));
QRG_Akt := ParmStr(8,Km,G^.DZeile);
if QRG_Akt = '' then QRG_Akt := PseudoQRG;
end;
end;
for C := 0 to maxLink do
begin
with K[C]^ do
begin
if C > 0 then
begin
MerkRead(Rrch + int_str(C) + ':CALL');
if G^.DZeile > '' then OwnCall := G^.DZeile;
MerkRead(Rrch + int_str(C) + ':AUTO');
if G^.DZeile > '' then
begin
AutoZyConst := Word(str_int(G^.DZeile));
if AutoZyConst > 0 then CSelf := 2;
end;
end;
MerkRead(Rrch + int_str(C) + Rpar);
if G^.DZeile > '' then
begin
MaxFrame := Byte(str_int(ParmStr(1,Km,G^.DZeile)));
if not (MaxFrame in [1..7]) then MaxFrame := 1;
PacLen := Word(str_int(ParmStr(2,Km,G^.DZeile)));
if not (PacLen in [1..FF]) then PacLen := FF;
ObStat := Byte(str_int(ParmStr(3,Km,G^.DZeile)));
UnStat := Byte(str_int(ParmStr(4,Km,G^.DZeile)));
UmlautMerk := Byte(str_int(ParmStr(5,Km,G^.DZeile)));
if not (UmlautMerk in UmlMenge) then UmlautMerk := 0;
end;
MerkRead(Rrch + int_str(C) + ':RXS');
if G^.DZeile > '' then
begin
FRxName := G^.DZeile;
if OpenTextFile(C) then
begin
RX_Count := 0;
RX_Laenge := 0;
RX_Bin := 0;
RX_Save := true;
FTxName := G^.Drive;
end;
end else
begin
FRxName := G^.SavePfad + TxtName + SFillStr(3,'0',int_str(C));
FTxName := G^.SavePfad;
end;
MerkRead(Rrch + int_str(C) + ':SAV');
if G^.DZeile > '' then
begin
SvName := G^.DZeile;
Assign(SFile,SvName);
Result := ResetBin(SFile,T);
if Result = 0 then Seek(SFile,FileSize(SFile))
else Result := RewriteBin(SFile,T);
if Result = 0 then Save := true;
end else
begin
SvName := G^.SavePfad + SaveName + SFillStr(3,'0',int_str(C));
end;
MerkRead(Rrch + int_str(C) + ':7PL');
if G^.DZeile > '' then
begin
Assign(SplFile,ParmStr(1,' ',G^.DZeile));
if ResetBin(SplFile,T) = 0 then
begin
Seek(SplFile,FileSize(SplFile));
SPlus := true;
SplSave := true;
Spl_gLaenge := LongInt(str_int(ParmStr(2,' ',G^.DZeile)));
Spl_gCount := LongInt(str_int(ParmStr(3,' ',G^.DZeile)));
Spl_tLaenge := LongInt(str_int(ParmStr(4,' ',G^.DZeile)));
Spl_tCount := LongInt(str_int(ParmStr(5,' ',G^.DZeile)));
end;
end;
MerkRead(Rrch + int_str(C) + ':FLAG');
if G^.DZeile > '' then
begin
i := pos('E',G^.DZeile);
if i > 0 then
begin
inc(i);
Hstr := copy(G^.DZeile,i,1);
i := Byte(str_int(Hstr));
if i in [1..7] then Echo := i;
end;
i := pos('U',G^.DZeile);
if i > 0 then
begin
inc(i);
Hstr := copy(G^.DZeile,i,1);
i := Byte(str_int(Hstr));
if i in [1..4] then Umlaut := i;
end;
Gross := (pos('Y',G^.DZeile) = 0);
if C > 0 then
begin
TopBox := (pos('M',G^.DZeile) > 0);
Auto := (pos('F',G^.DZeile) > 0);
RX_Beep := (pos('∞',G^.DZeile) > 0);
morsen := (pos('C',G^.DZeile) > 0);
TxBeepAck := (pos('Q',G^.DZeile) > 0);
Speek := (pos('P',G^.DZeile) > 0);
AutoBin := (pos('$',G^.DZeile) > 0);
SPlus := (pos('+',G^.DZeile) > 0);
TxComp := (pos('°',G^.DZeile) > 0);
RxComp := (pos('≈',G^.DZeile) > 0);
NoCurJump := (pos('÷',G^.DZeile) > 0);
end else
begin
Klingel := (pos('K',G^.DZeile) > 0);
CtrlBeep := (pos('G',G^.DZeile) > 0);
Time_Stamp := (pos('T',G^.DZeile) > 0);
PacOut := (pos('L',G^.DZeile) > 0);
ZeigeRET := (pos('R',G^.DZeile) > 0);
ConMorsen := (pos('O',G^.DZeile) > 0);
ReconMorsen := (pos('D',G^.DZeile) > 0);
ConVoice := (pos('A',G^.DZeile) > 0);
ReconVoice := (pos('J',G^.DZeile) > 0);
GlobalTrenn := (pos('H',G^.DZeile) > 0);
BinOut := (pos('i',G^.DZeile) > 0);
Ins := (pos('Z',G^.DZeile) > 0);
NoBinMon := (pos('!',G^.DZeile) > 0);
RX_TX_Win := (pos('&',G^.DZeile) > 0);
end;
end;
end;
end;
MerkRead(Rrgl + Rsetl);
if G^.DZeile > '' then
begin
for i := 1 to 10 do G^.SETL[i] := Word(str_int(ParmStr(i,Km,G^.DZeile)));
SETNr := Byte(str_int(ParmStr(11,Km,G^.DZeile)));
if not (SETNr in [1..10]) then SETNr := 1;
end;
MerkRead(Rrgl + Ridle);
if G^.DZeile > '' then
begin
Idle_Pos := copy(G^.DZeile,1,1) = '1';
Idle_Anz := Word(str_int(ParmStr(2,Km,G^.DZeile)));
Idle_Tout := Word(str_int(ParmStr(3,Km,G^.DZeile)));
end;
MerkRead(Rrgl + Rmfreq);
if G^.DZeile > '' then G^.TonHoehe := Word(str_int(G^.DZeile));
MerkRead(Rrgl + Rega);
if G^.DZeile > '' then _VGA := copy(G^.DZeile,1,1) = '1';
MerkRead(Rrgl + Rplen);
if G^.DZeile > '' then MPause := Word(str_int(G^.DZeile));
MerkRead(Rrgl + Rsynch);
if G^.DZeile > '' then Resync_Z := Word(str_int(G^.DZeile));
MerkRead(Rrgl + Rcnr);
if G^.DZeile > '' then CNr := LongInt(str_int(G^.DZeile));
MerkRead(Rrgl + Rvsp);
if G^.DZeile > '' then VSpeed := Word(str_int(G^.DZeile));
MerkRead(Rrgl + Rinfo);
if G^.DZeile > '' then G^.InfoStr := G^.DZeile else G^.InfoStr := '';
FiResult := CloseTxt(G^.TFile);
end else (* If IOResult ... *)
begin
for i := 0 to maxLink do with K[i]^ do
begin
FRxName := G^.Drive + Txt + int_str(i) + Ext;
FTxName := G^.Drive;
end;
end;
End;